#include <OEvent.h>

void OEvent::Register(OObject *handler)
{
	EventHandlerList.push_back(handler);
}

void OEvent::UnRegister(OObject *handler)
{
	EventHandlerList.erase(remove(EventHandlerList.begin(),EventHandlerList.end(),handler),EventHandlerList.end());
}

void OEvent::Invoke()
{
	vector<OObject *>::const_iterator kItr;
	for (kItr=EventHandlerList.begin();kItr!=EventHandlerList.end();++kItr)   
		(*kItr)->Handler(); 
}